package com.i7time.qutan.utils;

import com.i7time.entity.FriendInfo;
import com.i7time.entity.User;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by Hsia on 16/6/14.
 */
public class SceneUtil {

    public static List<Object> memberUsers(List<User> users,List<FriendInfo> friends){

        List<Object> result=new ArrayList<>();
        for (User user:  users   ) {
            HashMap<String,String> newUser=new HashMap<>();
            newUser.put("userid",user.getId()+"");
            newUser.put("avatar",user.getAvatar());
            newUser.put("nickName",user.getNick_name());
            newUser.put("isMyFriend","0");
            /**处理朋友关系*/
            if(friends.contains(user)){
                int i=friends.indexOf(user);
                newUser.put("isMyFriend","1");
                newUser.put("nickName",friends.get(i).getFriendNickName());

            }


            result.add(newUser);
        }

        return result;
    }



}
